home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / answers / cryptography-faq / part08 < prev    next >
Encoding:
Internet Message Format  |  1993-06-18  |  18.5 KB

  1. Path: senator-bedfellow.mit.edu!enterpoop.mit.edu!pad-thai.aktis.com!pad-thai.aktis.com!not-for-mail
  2. From: crypt-comments@math.ncsu.edu
  3. Newsgroups: sci.crypt,sci.answers,news.answers
  4. Subject: Cryptography FAQ (08/10: Technical Miscellany; last mod 19930504)
  5. Supersedes: <cryptography-faq/part08_738648006@GZA.COM>
  6. Followup-To: poster
  7. Date: 19 Jun 1993 00:00:30 -0400
  8. Organization: The Crypt Cabal
  9. Lines: 369
  10. Sender: faqserv@GZA.COM
  11. Approved: news-answers-request@MIT.Edu
  12. Expires: 24 Jul 1993 04:00:05 GMT
  13. Message-ID: <cryptography-faq/part08_740462405@GZA.COM>
  14. References: <cryptography-faq/part01_740462405@GZA.COM>
  15. Reply-To: crypt-comments@math.ncsu.edu
  16. NNTP-Posting-Host: pad-thai.aktis.com
  17. X-Last-Updated: 1993/05/06
  18. Xref: senator-bedfellow.mit.edu sci.crypt:17446 sci.answers:263 news.answers:9559
  19.  
  20. Archive-name: cryptography-faq/part08
  21.  
  22.  
  23. This is the eighth of ten parts of the sci.crypt FAQ. The parts are
  24. mostly independent, but you should read the first part before the rest.
  25. We don't have the time to send out missing parts by mail, so don't ask.
  26. Notes such as ``[KAH67]'' refer to the reference list in the last part.
  27.  
  28. The sections of this FAQ are available via anonymous FTP to rtfm.mit.edu 
  29. as /pub/usenet/news.answers/cryptography-faq/part[xx]. The Cryptography 
  30. FAQ is posted to the newsgroups sci.crypt, sci.answers, and news.answers
  31. every 21 days.
  32.  
  33.  
  34. Contents
  35.  
  36. 8.1. How do I recover from lost passwords in WordPerfect?
  37. 8.2. How do I break a Vigenere (repeated-key) cipher?
  38. 8.3. How do I send encrypted mail under UNIX? [PGP, RIPEM, PEM, ...]
  39. 8.4. Is the UNIX crypt command secure?
  40. 8.5. How do I use compression with encryption?
  41. 8.6. Is there an unbreakable cipher?
  42. 8.7. What does ``random'' mean in cryptography?
  43. 8.8. What is the unicity point (a.k.a. unicity distance)?
  44. 8.9. What is key management and why is it important?
  45. 8.10. Can I use pseudo-random or chaotic numbers as a key stream?
  46. 8.11. What is the correct frequency list for English letters?
  47. 8.12. What is the Enigma?
  48. 8.13. How do I shuffle cards?
  49. 8.14. Can I foil S/W pirates by encrypting my CD-ROM?
  50. 8.15. Can you do automatic cryptanalysis of simple ciphers?
  51. 8.16. What is the coding system used by VCR+?
  52.  
  53.  
  54. 8.1. How do I recover from lost passwords in WordPerfect?
  55.  
  56.   WordPerfect encryption has been shown to be very easy to break.
  57.   The method uses XOR with two repeating key streams: a typed password
  58.   and a byte-wide counter initialized to 1+<the password length>. Full
  59.   descriptions are given in Bennett [BEN87] and Bergen and Caelli
  60.   [BER91].
  61.  
  62.   Chris Galas writes: ``Someone awhile back was looking for a way to
  63.   decrypt WordPerfect document files and I think I have a solution. 
  64.   There is a software company named: Accessdata (87 East 600 South,
  65.   Orem, UT 84058), 1-800-658-5199 that has a software package that will
  66.   decrypt any WordPerfect, Lotus 1-2-3, Quatro-Pro, MS Excel and Paradox
  67.   files. The cost of the package is $185. Steep prices, but if you
  68.   think your pw key is less than 10 characters, (or 10 char) give them a
  69.   call and ask for the free demo disk. The demo disk will decrypt files
  70.   that have a 10 char or less pw key.'' Bruce Schneier says the phone
  71.   number for AccessData is 801-224-6970.
  72.  
  73. 8.2. How do I break a Vigenere (repeated-key) cipher?
  74.  
  75.   A repeated-key cipher, where the ciphertext is something like the
  76.   plaintext xor KEYKEYKEYKEY (and so on), is called a Vigenere cipher.
  77.   If the key is not too long and the plaintext is in English, do the
  78.   following: 
  79.  
  80.   1. Discover the length of the key by counting coincidences.
  81.   (See Gaines [GAI44], Sinkov [SIN66].) Trying each displacement of
  82.   the ciphertext against itself, count those bytes which are equal. 
  83.   If the two ciphertext portions have used the same key, something
  84.   over 6% of the bytes will be equal. If they have used different
  85.   keys, then less than 0.4% will be equal (assuming random 8-bit bytes
  86.   of key covering normal ASCII text). The smallest displacement which
  87.   indicates an equal key is the length of the repeated key.
  88.  
  89.   2. Shift the text by that length and XOR it with itself. This
  90.   removes the key and leaves you with text XORed with itself. Since
  91.   English has about 1 bit of real information per byte, 2 streams of
  92.   text XORed together has 2 bits of info per 8-bit byte, providing
  93.   plenty of redundancy for choosing a unique decryption. (And in fact
  94.   one stream of text XORed with itself has just 1 bit per byte.)
  95.  
  96.   If the key is short, it might be even easier to treat this as a
  97.   standard polyalphabetic substitution. All the old cryptanalysis
  98.   texts show how to break those. It's possible with those methods, in
  99.   the hands of an expert, if there's only ten times as much text as key.
  100.   See, for example, Gaines [GAI44], Sinkov [SIN66].
  101.  
  102. 8.3. How do I send encrypted mail under UNIX? [PGP, RIPEM, PEM, ...]
  103.  
  104.   Here's one popular method, using the des command:
  105.  
  106.     cat file | compress | des private_key | uuencode | mail
  107.  
  108.   Meanwhile, there is a de jure Internet standard in the works called
  109.   PEM (Privacy Enhanced Mail). It is described in RFCs 1421 through
  110.   1424. To join the PEM mailing list, contact pem-dev-request@tis.com.
  111.   There is a beta version of PEM being tested at the time of this
  112.   writing.
  113.  
  114.   There are also two programs available in the public domain for encrypting
  115.   mail: PGP and RIPEM. Both are available by FTP. Each has its own
  116.   newsgroup: alt.security.pgp and alt.security.ripem. Each has its own FAQ
  117.   as well.
  118.  
  119.   PGP is most commonly used outside the USA since it uses the RSA algorithm
  120.   without a license and RSA's patent is valid only (or at least primarily)
  121.   in the USA.
  122.  
  123.   RIPEM is most commonly used inside the USA since it uses the RSAREF which
  124.   is freely available within the USA but not available for shipment outside
  125.   the USA.
  126.  
  127.   Since both programs use a secret key algorithm for encrypting the body of
  128.   the message (PGP used IDEA; RIPEM uses DES) and RSA for encrypting the
  129.   message key, they should be able to interoperate freely. Although there
  130.   have been repeated calls for each to understand the other's formats and
  131.   algorithm choices, no interoperation is available at this time (as far as
  132.   we know).
  133.  
  134. 8.4. Is the UNIX crypt command secure?
  135.  
  136.   No. See [REE84]. There is a program available called cbw (crypt
  137.   breaker's workbench) which can be used to do ciphertext-only attacks
  138.   on files encrypted with crypt. One source for CBW is [FTPCB].
  139.  
  140. 8.5. How do I use compression with encryption?
  141.  
  142.   A number of people have proposed doing perfect compression followed by
  143.   some simple encryption method (e.g., XOR with a repeated key).
  144.  
  145.   Unfortunately, you can only compress perfectly if you know the exact
  146.   distribution of possible inputs. For all practical purposes it's
  147.   impossible to describe ``the typical English text'' beyond coarse
  148.   characteristics such as single-letter frequencies. You can build up
  149.   more and more sophisticated models of your inputs, but if the enemy
  150.   has a slightly more accurate model, he'll be able to find some
  151.   redundancy in your compressed output.
  152.  
  153.   Note that nearly all practical compression schemes, unless they
  154.   have been designed with cryptography in mind, produce output that
  155.   actually starts off with high redundancy. For example, the output of
  156.   UNIX compress begins with a well-known three-byte ``magic number''
  157.   that can serve as an entering wedge for cryptanalysis.
  158.   
  159.   This is not to say that compression before encryption is inherently a
  160.   bad idea; it just has to be done very, very carefully, and by no means
  161.   removes the need for strong encryption.
  162.  
  163.   Compression after encryption is silly.
  164.  
  165. 8.6. Is there an unbreakable cipher?
  166.  
  167.   Yes. The one-time pad is unbreakable; see part 4. Unfortunately the
  168.   one-time pad requires secure distribution of as much key material as
  169.   plaintext.
  170.  
  171.   Of course, a cryptosystem need not be utterly unbreakable to be
  172.   useful. Rather, it needs to be strong enough to resist attacks by
  173.   likely enemies for whatever length of time the data it protects is
  174.   expected to remain valid.
  175.  
  176. 8.7. What does ``random'' mean in cryptography?
  177.  
  178.   Cryptographic applications demand much more out of a pseudorandom
  179.   number generator than most applications. For a source of bits to be
  180.   cryptographically random, it must be computationally impossible to
  181.   predict what the Nth random bit will be given complete knowledge of
  182.   the algorithm or hardware generating the stream and the sequence of
  183.   0th through N-1st bits, for all N up to the lifetime of the source.
  184.  
  185.   A software generator (also known as pseudo-random) has the function
  186.   of expanding a truly random seed to a longer string of apparently
  187.   random bits. This seed must be large enough not to be guessed by
  188.   the opponent. Ideally, it should also be truly random (perhaps
  189.   generated by a hardware random number source).
  190.  
  191.   Those who have Sparcstation 1 workstations could, for example,
  192.   generate random numbers using the audio input device as a source of
  193.   entropy, by not connecting anything to it. For example,
  194.  
  195.         cat /dev/audio | compress - >foo
  196.  
  197.   gives a file of high entropy (not random but with much randomness in
  198.   it). One can then encrypt that file using part of itself as a key,
  199.   for example, to convert that seed entropy into a pseudo-random
  200.   string.
  201.  
  202.   When looking for hardware devices to provide this entropy, it is
  203.   important really to measure the entropy rather than just assume that
  204.   because it looks complicated to a human, it must be "random". For
  205.   example, disk operation completion times sound like they might be
  206.   unpredictable (to many people) but a spinning disk is much like a
  207.   clock and its output completion times are relatively low in entropy.
  208.  
  209. 8.8. What is the unicity point (a.k.a. unicity distance)?
  210.  
  211.   See [SHA49]. The unicity distance is an approximation to that amount
  212.   of ciphertext such that the sum of the real information (entropy) in
  213.   the corresponding source text and encryption key equals the number
  214.   of ciphertext bits used. Ciphertexts significantly longer than this
  215.   can be shown probably to have a unique decipherment. This is used to
  216.   back up a claim of the validity of a ciphertext-only cryptanalysis. 
  217.   Ciphertexts significantly shorter than this are likely to have
  218.   multiple, equally valid decryptions and therefore to gain security
  219.   from the opponent's difficulty choosing the correct one.
  220.  
  221.   Unicity distance, like all statistical or information-theoretic
  222.   measures, does not make deterministic predictions but rather gives
  223.   probabilistic results: namely, the minimum amount of ciphertext
  224.   for which it is likely that there is only a single intelligible
  225.   plaintext corresponding to the ciphertext, when all possible keys
  226.   are tried for the decryption. Working cryptologists don't normally
  227.   deal with unicity distance as such. Instead they directly determine
  228.   the likelihood of events of interest.
  229.  
  230.   Let the unicity distance of a cipher be D characters. If fewer than
  231.   D ciphertext characters have been intercepted, then there is not
  232.   enough information to distinguish the real key from a set of
  233.   possible keys. DES has a unicity distance of 17.5 characters,
  234.   which is less than 3 ciphertext blocks (each block corresponds to
  235.   8 ASCII characters). This may seem alarmingly low at first, but
  236.   the unicity distance gives no indication of the computational work
  237.   required to find the key after approximately D characters have been
  238.   intercepted.
  239.  
  240.   In fact, actual cryptanalysis seldom proceeds along the lines used
  241.   in discussing unicity distance. (Like other measures such as key
  242.   size, unicity distance is something that guarantees insecurity if
  243.   it's too small, but doesn't guarantee security if it's high.) Few
  244.   practical cryptosystems are absolutely impervious to analysis; all
  245.   manner of characteristics might serve as entering ``wedges'' to crack
  246.   some cipher messages. However, similar information-theoretic
  247.   considerations are occasionally useful, for example, to determine a
  248.   recommended key change interval for a particular cryptosystem.
  249.   Cryptanalysts also employ a variety of statistical and
  250.   information-theoretic tests to help guide the analysis in the most
  251.   promising directions.
  252.  
  253.   Unfortunately, most literature on the application of information
  254.   statistics to cryptanalysis remains classified, even the seminal
  255.   1940 work of Alan Turing (see [KOZ84]). For some insight into the
  256.   possibilities, see [KUL68] and [GOO83].
  257.  
  258. 8.9. What is key management and why is it important?
  259.  
  260.   One of the fundamental axioms of cryptography is that the enemy is in
  261.   full possession of the details of the general cryptographic system,
  262.   and lacks only the specific key data employed in the encryption. (Of
  263.   course, one would assume that the CIA does not make a habit of telling
  264.   Mossad about its cryptosystems, but Mossad probably finds out anyway.)
  265.   Repeated use of a finite amount of key provides redundancy that can
  266.   eventually facilitate cryptanalytic progress. Thus, especially in
  267.   modern communication systems where vast amounts of information are
  268.   transferred, both parties must have not only a sound cryptosystem but
  269.   also enough key material to cover the traffic.
  270.  
  271.   Key management refers to the distribution, authentication, and
  272.   handling of keys.
  273.  
  274.   A publicly accessible example of modern key management technology
  275.   is the STU III secure telephone unit, which for classified use
  276.   employs individual coded ``Crypto Ignition Keys'' and a central Key
  277.   Management Center operated by NSA. There is a hierarchy in that
  278.   certain CIKs are used by authorized cryptographic control
  279.   personnel to validate the issuance of individual traffic keys and
  280.   to perform installation/maintenance functions, such as the
  281.   reporting of lost CIKs.
  282.  
  283.   This should give an inkling of the extent of the key management
  284.   problem. For public-key systems, there are several related issues,
  285.   many having to do with ``whom do you trust?''
  286.  
  287. 8.10. Can I use pseudo-random or chaotic numbers as a key stream?
  288.  
  289.   Chaotic equations and fractals produce an apparent randomness from
  290.   relatively compact generators. Perhaps the simplest example is a
  291.   linear congruential sequence, one of the most popular types of random
  292.   number generators, where there is no obvious dependence between seeds
  293.   and outputs. Unfortunately the graph of any such sequence will, in a
  294.   high enough dimension, show up as a regular lattice. Mathematically
  295.   this lattice corresponds to structure which is notoriously easy for
  296.   cryptanalysts to exploit. More complicated generators have more
  297.   complicated structure, which is why they make interesting pictures---
  298.   but a cryptographically strong sequence will have no computable
  299.   structure at all.
  300.  
  301.   See [KNU81], exercise 3.5-7; [REE77]; and [BOY89].
  302.  
  303. 8.11. What is the correct frequency list for English letters?
  304.  
  305.   There are three answers to this question, each slightly deeper than
  306.   the one before. You can find the first answer in various books:
  307.   namely, a frequency list computed directly from a certain sample of
  308.   English text.
  309.  
  310.   The second answer is that ``the English language'' varies from author
  311.   to author and has changed over time, so there is no definitive list.
  312.   Of course the lists in the books are ``correctly'' computed, but
  313.   they're all different: exactly which list you get depends on which
  314.   sample was taken. Any particular message will have different
  315.   statistics from those of the language as a whole.
  316.  
  317.   The third answer is that yes, no particular message is going to have
  318.   exactly the same characteristics as English in general, but for all
  319.   reasonable statistical uses these slight discrepancies won't matter.
  320.   In fact there's an entire field called ``Bayesian statistics'' (other
  321.   buzzwords are ``maximum entropy methods'' and ``maximum likelihood
  322.   estimation'') which studies questions like ``What's the chance that a
  323.   text with these letter frequencies is in English?'' and comes up with
  324.   reasonably robust answers.
  325.  
  326.   So make your own list from your own samples of English text. It will
  327.   be good enough for practical work, if you use it properly.
  328.  
  329. 8.12. What is the Enigma?
  330.  
  331.   ``For a project in data security we are looking for sources of
  332.   information about the German Enigma code and how it was broken by
  333.   the British during WWII.''
  334.  
  335.   See [WEL82], [DEA85], [KOZ84], [HOD83], [KAH91].
  336.  
  337. 8.13. How do I shuffle cards?
  338.  
  339.   Card shuffling is a special case of the permutation of an array of
  340.   values, using a random or pseudo-random function. All possible output
  341.   permutations of this process should be equally likely. To do this, you
  342.   need a random function (modran(x)) which will produce a uniformly
  343.   distributed random integer in the interval [0..x-1]. Given that
  344.   function, you can shuffle with the following [C] code: (assuming ARRLTH
  345.   is the length of array arr[] and swap() interchanges values at the two
  346.   addresses given)
  347.  
  348.   for ( n = ARRLTH-1; n > 0 ; n-- ) swap( &arr[modran( n+1 )], &arr[n] ) ;
  349.  
  350.   modran(x) can not be achieved exactly with a simple (ranno() % x) since
  351.   ranno()'s interval may not be divisible by x, although in most cases the
  352.   error will be very small. To cover this case, one can take ranno()'s
  353.   modulus mod x, call that number y, and if ranno() returns a value less
  354.   than y, go back and get another ranno() value.
  355.  
  356.   See [KNU81] for further discussion.
  357.  
  358. 8.14. Can I foil S/W pirates by encrypting my CD-ROM?
  359.  
  360.   Someone will frequently express the desire to publish a CD-ROM with
  361.   possibly multiple pieces of software, perhaps with each encrypted
  362.   separately, and will want to use different keys for each user (perhaps
  363.   even good for only a limited period of time) in order to avoid piracy.
  364.  
  365.   As far as we know, this is impossible, since there is nothing in standard
  366.   PC or workstation hardware which uniquely identifies the user at the
  367.   keyboard. If there were such an identification, then the CD-ROM could be
  368.   encrypted with a key based in part on the one sold to the user and in
  369.   part on the unique identifier. However, in this case the CD-ROM is one
  370.   of a kind and that defeats the intended purpose.
  371.  
  372.   If the CD-ROM is to be encrypted once and then mass produced, there must
  373.   be a key (or set of keys) for that encryption produced at some stage in
  374.   the process. That key is useable with any copy of the CD-ROM's data.
  375.   The pirate needs only to isolate that key and sell it along with the
  376.   illegal copy.
  377.  
  378. 8.15. Can you do automatic cryptanalysis of simple ciphers?
  379.  
  380.   Certainly. For commercial products you can try AccessData; see
  381.   question 8.1. We are not aware of any FTP sites for such software,
  382.   but there are many papers on the subject. See [PEL79], [LUC88],
  383.   [CAR86], [CAR87], [KOC87], [KOC88], [KIN92], [KIN93], [SPI93].
  384.  
  385. 8.16. What is the coding system used by VCR+?
  386.  
  387.   One very frequently asked question in sci.crypt is how the VCR+ codes
  388.   work. See [SHI92] for an attempt to describe it.
  389.